package AbstractTransaction

import (
	"fmt"
	"salary_payment_case/Model"
)

type ChangeAffiliationTransaction struct {
	ChangeEmployeeTransaction
	AffiliationTransaction
}

type AffiliationTransaction interface {
	RecordMembership(employee *Model.Employee)
	GetAffiliation() Model.Affiliation
}

func (ch *ChangeAffiliationTransaction) Change(employee *Model.Employee) {
	ch.RecordMembership(employee)
	af := ch.GetAffiliation()
	employee.SetAffiliation(af)
}

func (ch *ChangeAffiliationTransaction) CalculateDeductions(pc Model.Paycheck) {
	err := fmt.Errorf("The method or operation is not implemented.")
	fmt.PrintIn(err)
}
